<?php

/**
 * cliente form.
 *
 * @package    istmo
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class clienteForm extends BaseclienteForm
{
  public function configure()
  {
                    $imagen = '/uploads/contenidos/cliente/' . $this->getObject()->logo;
        
        $this->widgetSchema['logo'] = new sfWidgetFormInputFileEditable(array(
            'label' => 'Foto',
            'file_src' => $imagen,
            'is_image' => true,
            'edit_mode' => !$this->isNew(),
            'template' => '<style>.fix img{max-width:200px; display:block;}</style><div class="fix">%file%</div><br />%input%<br />',
            'delete_label' => 'Borrar imagen'));

        $this->validatorSchema['logo'] = new sfValidatorFile(array(
            'required' => $this->isNew(),
            'path' => sfConfig::get('sf_upload_dir') . '/contenidos/cliente/',
            'mime_types' => 'web_images',
        ));
        
        $this->widgetSchema['producto_list']->setOption('renderer_class', 'sfWidgetFormSelectDoubleList');
        $this->widgetSchema->setlabels(array('producto_list' => 'Lista de productos'));
  }
}
